/*
 * @Author: HuangYue
 * @Date: 2022-05-12 12:55:50
 * @LastEditors: HuangYue
 * @LastEditTime: 2022-05-12 15:41:31
 * @FilePath: /graduation/src/components/DeviceDetail/DeviceVisualization/MRI/index.jsx
 * @Description:
 */
import React from 'react';
import { Row, Col } from 'antd';
import { GridContent } from '@ant-design/pro-layout';
import ChartCard from '../../../../pages/DataVisualization/components/ChartCard';
import DemoLine from './Line';
import moment from 'moment';
const getData = (x, y) => x + Number(Math.random() * (y - x));
const HEPressure = [];
const HElevel = [];
const H2OPressure = [];
const H2OTemperature = [];
const beginDay = new Date().getTime();
for (let i = 0; i < 30; i++) {
  HEPressure.unshift({
    time: moment(new Date(beginDay - 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
    count: getData(4, 5),
  });
  HElevel.unshift({
    time: moment(new Date(beginDay - 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
    count: getData(80, 90),
  });
  H2OPressure.unshift({
    time: moment(new Date(beginDay - 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
    count: getData(14, 18),
  });
  H2OTemperature.unshift({
    time: moment(new Date(beginDay - 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
    count: getData(22, 24),
  });
}
function MRIVisualization() {
  return (
    <GridContent>
      <>
        <Row gutter={24}>
          <Col xl={12} lg={24} md={24} sm={24} xs={24}>
            <ChartCard title="液氦压力">
              <DemoLine data={HEPressure} max={5} min={4} />
            </ChartCard>
          </Col>
          <Col xl={12} lg={24} md={24} sm={24} xs={24}>
            <ChartCard title="液氦水平">
              <DemoLine data={HElevel} max={90} min={80} />
            </ChartCard>
          </Col>
        </Row>
        <Row gutter={24} style={{ marginTop: 24 }}>
          <Col xl={12} lg={24} md={24} sm={24} xs={24}>
            <ChartCard title="水流压力">
              <DemoLine data={H2OPressure} max={20} min={10} />
            </ChartCard>
          </Col>
          <Col xl={12} lg={24} md={24} sm={24} xs={24}>
            <ChartCard title="水流温度">
              <DemoLine data={H2OTemperature} max={25} min={20} />
            </ChartCard>
          </Col>
        </Row>
      </>
    </GridContent>
  );
}

export default MRIVisualization;
